<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title>商品类动销分析 - 华衣云商ERP系统</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">

<div class="layui-body" style="padding:15px;top: 0px;">
    <style type="text/css">
        .T-box {
            width: 400px;
            padding: 0 20px;
            text-align: left;
        }

        .T-box p {
            position: relative;
            height: 36px;
            line-height: 36px;
            font-size: 14px;
            margin-bottom: 15px;
        }

        .T-box p span {
            display: inline-block;
            padding-right: 15px;
            text-align: right;
            width: 110px;
            line-height: 36px;
            font-size: 14px;
        }

        .T-box p input, .T-box p select {
            width: 160px;
            padding: 0 5px;
            height: 34px;
            line-height: 34px;
            font-size: 14px;
            border: 1px solid #d3d3d3;
            outline: none;
        }

        .T-box p i {
            padding: 0 10px;
            line-height: 36px;
            font-style: normal;
        }

        .T-box p b {
            display: inline-block;
            margin-left: 10px;
            cursor: pointer;
            width: 60px;
            height: 36px;
            line-height: 36px;
            background: #c33;
            color: #fff;
            text-align: center;
            font-size: 13px;
            font-weight: normal;
        }

        .T-result {
            margin-bottom: 0;
        }

        .T-result em {
            color: #c33;
            font-style: normal;
        }
    </style>
        <div class="layui-tab layui-tab-brief" lay-filter="demo">
            <ul class="layui-tab-title">
    
<!--                <li > <a href="/zbj/live_data_list">直播间数据管理</a></li>-->
<!--                <li> <a href="/zbj/sales_statistics_douyin">直播间销售统计</a></li>-->
<!--                <li > <a href="/zbj/sample_list">直播间样品管理</a></li>-->


                <li> <a href="/report/goods_sales_analyse">商品动销</a></li>
                <li class="layui-this"> <a href="/report/goods_category_analyse">类目动销</a></li>

            </ul>
        </div>
    <!-- start sp-wrapper -->
    <fieldset class="layui-elem-field">
        <legend>按条件搜索</legend>
        <div class="layui-field-box">
            <form class="layui-form layui-form-pane1" method="get" th:action="${searchUrl}">
                <div class="layui-form-item">
                    <div class="layui-inline">
<!--                        <button type="submit" class="layui-btn">搜索</button>-->
                        <i>总共：&nbsp;[[${totalSize}]]&nbsp;条记录</i>
                    </div>
<!--                    <a class="layui-btn layui-btn-primary" href="javascript:;" id="export_order">导出excel</a>-->
                    <div class="layui-inline"></div>

                </div>
            </form>



        </div>
    </fieldset>

    <link rel="stylesheet" href="/sb/stock.css"/>
    <div class="sp-wrapper">
        <div class="sp-table">
            <table>
                <thead>
                <tr>
                    <th>商品分类</th>
                    <th>款式总数</th>
                    <th>SKU总数</th>
                    <th>采购入库总数</th>
                    <th>销售总数</th>
                    <th>当前库存</th>
                    <th>动销率</th>
                </tr>
                </thead>
                <tbody id="sp-data">
                <tr th:each="item:${list}">
                    <td th:text="${item.getParentName()+' - '+item.getCategoryName()}"></td>
                    <td th:text="${item.getGoodsCount()}" ></td>
                    <td th:text="${item.getSkuCount()}">1</td>
                    <td th:text="${item.buyQty}">0</td>
                    <td th:text="${item.salesCount}">0</td>
                    <td >
                        <span th:switch="${item.getCurrentQty()}">
                            <b th:case="0" >0</b>
                            <b th:case="*" style="font-weight: bold" th:text="${item.getCurrentQty()}"></b>
                        </span>
                    </td>
                    <td >
                        <span class="dxl" th:attr="b=${item.buyQty},s=${item.salesCount}" style="font-weight: bold"> -- </span>
                    </td>
                </tr>
                </tbody>
            </table>

        </div>
    </div>



    <script type="text/javascript" src="/sb/jquery.min.js"></script>
    <script type="text/javascript" src="/sb/Tips.min.js"></script>
    <script type="text/javascript">


    </script>
    <!-- end sp-wrapper -->
    <script>
        layui.use(['laydate', 'layer','form'], function () {
            var laydate = layui.laydate;
            var layer = layui.layer;
            var form = layui.form;
        });

        $(function () {
            $(".dxl").each(function () {
                var b = $(this).attr("b");
                var s = $(this).attr("s");
                if(b > 0) {
                    var dxl = parseFloat(s) / parseFloat(b) * 100;
                    $(this).text(dxl.toFixed(2)+"%")
                    $(this).css("color","red")
                }
            })
            //导出订单
            $("#export_order").click(function () {
                layer.msg("未实现")
            })

        });
    </script>
</div>
</body>
<html>
